<?php if (isset($history)) { ?>
    <ul class="list-group alt">
        <?php foreach ($history as $record) { ?>
            <li class="list-group-item">
                <div class="media">
                    <!--<span class="pull-left thumb-sm">
                        <?php
                        $img_path = $record['member_image'];
                        $alt_path = $this->Html->url("/img/avatar_default.jpg");
                        ?>
                        <img src="<?php echo $img_path; ?>" class='img-circle' onerror="if (this.src != '<?php echo $alt_path; ?>') this.src = '<?php echo $alt_path; ?>';">

                    </span>-->

                    <div class="media-body">
                        <div class='col-sm-6'>
                            <a href="#" class='font-bold'>
                                <?php echo $record['list_name'] . ' <span class="text-xs text-muted">&bull; ' . $record['size'] . "</span>"; ?>
                            </a>
                        </div>

                        <!--<div class='col-sm-3'>
                            <small class='text-muted text-xs'><?php //echo $record['number']; ?></small>
                        </div>-->

                        <div class='col-sm-6 text-right'>
                            <small class="text-muted text-xs">
                                <?php echo $record['sent'] == 1 ? 'Sent On ' : "Scheduled For "; ?>
                                <?php echo $this->Time->format('D d-M, H:i', $record['schedule']); ?>
                            </small>
                        </div>

                        <div class='col-sm-11 m-t-xs'>
                            <small class='text-sm'><?php echo $record['message']; ?></small>
                        </div>

                        <div class='col-sm-1 m-t-xs'>
                            <?php $klass = $record['sent'] == 1 ? 'text-success' : 'text-warning'; ?>
                            <div class="pull-right <?php echo $klass; ?>">
                                <i class="fa fa-circle"></i>
                            </div>
                        </div>

                    </div>
                </div>
            </li>
        <?php } ?>
    </ul>
<?php } else { ?>
<div class="alert alert-info">
    History of messages sent will be displayed here.
</div>
<?php } ?>
